﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="list_cities.aspx.cs" Inherits="RastinArgham.CRM.Web.list_cities" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3 class="ui-widget-header">
            <asp:Literal ID="lbtitle" runat="server" Text="تعریف شهرها" />
    </h3>

    <div class="ui-layout-content ui-widget-content">
    
        استان : 
        <asp:DropDownList ID="ddlProvinces" runat="server" AutoPostBack="true" 
            DataTextField="ProvinceName" DataValueField="ProvinceId" 
            AppendDataBoundItems="true" 
            onselectedindexchanged="ddlProvinces_SelectedIndexChanged">
             <asp:ListItem Text="---" Value="-1" />
        </asp:DropDownList>

        <div class="space2"></div>
        
        <div id="divCityData" runat="server">

        <mani:PagingGridView runat="server" ID="gvCities" 
            AutoGenerateColumns="false" GridLines="none" DataKeyNames="CityId" 
            onrowcreated="gvCities_RowCreated" onrowdeleting="gvCities_RowDeleting">

            <Columns>
                <asp:BoundField HeaderText="کد" DataField="CityId" />
                <asp:BoundField HeaderText="نام شهر" DataField="CityName" />
                <asp:BoundField HeaderText="نام استان" DataField="ProvinceName" />

                <asp:TemplateField HeaderText="حذف">
                    <itemtemplate>
                        <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="False" CommandName="Delete">
                                <img src="/App_Themes/<%=Page.Theme %>/images/delete.gif" alt="" style="border:0;" />
                        </asp:LinkButton>
                    </itemtemplate>
                </asp:TemplateField>
            </Columns>
        </mani:PagingGridView>

         <div class="space2"></div>

        <h3>ایجاد شهر جدید</h3>

        <table>
            <tr>
                <td>
                    نام شهر
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtCityName"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvCityName" ControlToValidate="txtCityName" runat="server" ErrorMessage="*" ValidationGroup="AddEditCity" />
                </td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnSave" runat="server" Text="ذخیره تغییرات" 
                        onclick="btnSave_Click" ValidationGroup="AddEditCity" />
                </td>
            </tr>
        </table>

        </div>

    </div>
</asp:Content>